﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Site.master" AutoEventWireup="true" CodeBehind="Infomation.aspx.cs" Inherits="Indochinaodyssey.Admin.Infomation" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<%@ Register assembly="FredCK.FCKeditorV2" namespace="FredCK.FCKeditorV2" tagprefix="FCKeditorV2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            font-size: large;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <div>
            <asp:Panel ID="pnInfo" runat="server" CssClass="pnInfo" Visible="False">
                <fieldset>
                    <legend>
                        <asp:Label ID="lblInfo" runat="server" Text="Thông tin Infomation"></asp:Label>
                    </legend>
                    <div>
                        <table width="100%">
                            <tr>
                                <td class="leftInfo">
                                    Quốc gia</td>
                                <td >
                                    <asp:DropDownList ID="ddlQuocGia" runat="server" AutoPostBack="True" 
                                        DataSourceID="ObjectDataSource1" DataTextField="TenQuocGia" DataValueField="Id" 
                                        Width="200px">
                                    </asp:DropDownList>
                                    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                                        SelectMethod="GetAll" TypeName="IOBusiness.clsBSQuocGia">
                                    </asp:ObjectDataSource>
                                </td>
                            </tr>
                            <tr>
                                <td class="leftInfo">
                                    Thể loại</td>
                                <td>
                                    <asp:DropDownList ID="ddlTheLoai" runat="server" Width="200px" 
                                        DataSourceID="ObjectDataSource2" DataTextField="TenTheLoai" 
                                        DataValueField="Id" ondatabinding="ddlTheLoai_DataBinding" 
                                        onload="ddlTheLoai_Load">
                                    </asp:DropDownList>
                                    <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" 
                                        SelectMethod="GetByQuocGia" TypeName="IOBusiness.clsBSTheLoai">
                                        <SelectParameters>
                                            <asp:ControlParameter ControlID="ddlQuocGia" Name="id" 
                                                PropertyName="SelectedValue" Type="Int32" />
                                            <asp:Parameter DefaultValue="1" Name="danhmuc" Type="Int32" />
                                        </SelectParameters>
                                    </asp:ObjectDataSource>
                                </td>
                            </tr>
                            <tr>
                                <td class="leftInfo">
                                    Tiêu đề</td>
                                <td>
                                    <asp:TextBox ID="txtTieuDe" runat="server" Width="500px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="leftInfo">
                                    Nội dung</td>
                                <td >
                                    <FCKeditorV2:FCKeditor ID="txtNoiDung" runat="server" Height="400px">
                                    </FCKeditorV2:FCKeditor>
                                </td>
                            </tr>
                            <tr>
                                <td class="leftInfo">
                                    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
                                    </asp:ToolkitScriptManager>
                                </td>
                                <td >
                                    <asp:Button ID="btnSave" runat="server" onclick="btnSave_Click" Text="Lưu" />
                                    &nbsp;
                                    <asp:Button ID="btnCancel" runat="server" PostBackUrl="~/Admin/Infomation.aspx" 
                                        Text="Hủy" CausesValidation="False" />
                                </td>
                            </tr>
                        </table>
                    </div>
                </fieldset>
            </asp:Panel>
        </div>
        <div>
            <table width="100%" >
                <tr>
                    <td >
                        <strong><span class="style1">Quản lý Infomation</span></strong><asp:ObjectDataSource ID="odsInfomation" runat="server" 
                            DeleteMethod="Delete" SelectMethod="GetAll" 
                            TypeName="IOBusiness.clsBSInfomation">
                            <DeleteParameters>
                                <asp:Parameter Name="id" Type="Int32" />
                            </DeleteParameters>
                        </asp:ObjectDataSource>
                    </td>
                    <td align="right">
                        <asp:HyperLink ID="HyperLink1" runat="server" 
                            NavigateUrl="Infomation.aspx?action=new">Tạo mới &gt;&gt;</asp:HyperLink>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                            AutoGenerateColumns="False" CellPadding="4" DataSourceID="odsInfomation" 
                            ForeColor="#333333" GridLines="None" Width="100%" 
                            onrowcommand="GridView1_RowCommand">
                            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                            <Columns>
                                <asp:BoundField DataField="Id" HeaderText="Mã" SortExpression="Id" >
                                <ItemStyle Width="30px" />
                                </asp:BoundField>
                                <asp:BoundField DataField="TieuDe" HeaderText="Tiêu Đề" 
                                    SortExpression="TieuDe" />
                                <asp:HyperLinkField DataNavigateUrlFields="ID" 
                                    DataNavigateUrlFormatString="Infomation.aspx?action=edit&amp;id={0}" 
                                    Text="Sửa">
                                <ItemStyle Width="20px" />
                                </asp:HyperLinkField>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:LinkButton ID="lbtnXoa" runat="server" 
                                            onclientclick="return confirm('Bạn có muốn xóa không?')" 
                                            CommandArgument='<%# Eval("Id") %>' CommandName="Xoa">Xóa</asp:LinkButton>
                                    </ItemTemplate>
                                    <ItemStyle Width="40px" />
                                </asp:TemplateField>
                            </Columns>
                            <EditRowStyle BackColor="#999999" />
                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                            <SortedAscendingCellStyle BackColor="#E9E7E2" />
                            <SortedAscendingHeaderStyle BackColor="#506C8C" />
                            <SortedDescendingCellStyle BackColor="#FFFDF8" />
                            <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                        </asp:GridView>
                    </td>
                </tr>
            </table>
        </div>
        <br />
    </div>
</asp:Content>
